package com.demo.design02.channel;

import com.demo.design02.mode.IPayModel;

import java.math.BigDecimal;

/**
 * @author ytj
 * @date 2022/2/22
 */
public class WxPay extends Pay{

    public WxPay(IPayModel payModel){
        super(payModel);
    }
    public String transfer(String uId, String tradeId, BigDecimal amount) {
        logger.info("模拟微信渠道支付划账开始。uId:{},tradeId:{},amount:{}",uId,tradeId,amount);
        boolean security= payModel.security(uId);
        logger.info("模拟微信渠道支付风控校验。uId:{},tradeId:{},security:{}",uId,tradeId,security);
        if(!security){
            logger.info("模拟微信渠道支付划账拦截。uId:{},tradeId:{},amount:{}",uId,tradeId,amount);
            return "0001";
        }
        logger.info("模拟微信渠道支付划账成功。。uId:{},tradeId:{},amount:{}",uId,tradeId,amount);
        return "0000";
    }

}
